if(typeof Ext.user.method.usercityidstore == 'undefined') Ext.user.method.usercityidstore = Ext.user.method.usercityid('/Yuyue/data/');
if(typeof Ext.user.method.userbinzhongidstore == 'undefined') Ext.user.method.userbinzhongidstore = Ext.user.method.userbinzhongid('/Yuyue/data/');
Ext.user.info = Ext.extend(Ext.form.FormPanel, {
    title: '',
    padding: 10,
    autoScroll: true,
	id:'info',
	formId:'Formidinfo',
	layout: 'table',
	layoutConfig: {
        columns: 2
    },
    initComponent: function() {
        this.items = [
            {
				width:430,
				height:400,
                xtype: 'fieldset',
				valign:'top',
                title: '咨询信息',
                items: [
                    {
                        xtype: 'textfield',
						name:'ipaddr',
                        fieldLabel: 'IP地址',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
						xtype: 'combo',
						fieldLabel: '地区',
						anchor: '50%',
						name:'city', 
						store: Ext.user.method.usercityidstore,
						displayField:'name',
						valueField:'id',
						hiddenName:'city',
						hiddenValue:'0',
						editable:false,
						typeAhead: true,
						forceSelection: true,
						mode: 'local',
						triggerAction: 'all',
						emptyText:'请选择',
						selectOnFocus:true,
						style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'gopage', 
                        fieldLabel: '进入页',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'askpage', 
                        fieldLabel: '咨询页',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'keyword',
                        fieldLabel: '搜索引擎/关键字',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },

                    {
						xtype: 'combo',
						name:'binzhong',
						fieldLabel: '病种',
						anchor: '50%',
						name:'binzhong', 
						store: Ext.user.method.userbinzhongidstore,
						displayField:'name',
						valueField:'id',
						hiddenName:'binzhongid',
						hiddenValue:'0',
						editable:false,
						typeAhead: true,
						forceSelection: true,
						mode: 'local',
						triggerAction: 'all',
						emptyText:'请选择',
						selectOnFocus:true,
						style: 'margin-bottom:5px;'
                    },
                    {
						xtype: 'combo',
						name:'askway',
						fieldLabel: '咨询渠道',
						anchor: '50%',
						store: Ext.user.method.qudao(),
						displayField:'name',
						valueField:'id',
						hiddenName:'askway',
						hiddenValue:'0',
						editable:false,
						typeAhead: true,
						forceSelection: true,
						mode: 'local',
						triggerAction: 'all',
						emptyText:'请选择',
						selectOnFocus:true,
						style: 'margin-bottom:5px;'
                    },   
                    {
                        xtype: 'textfield',
						name:'qq',
                        fieldLabel: 'QQ号（选填）',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'      
                    },
                    {
                        xtype: 'textfield',
						name:'asker',
                        fieldLabel: '咨询员',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    }
                ]
            },
		
            {
				width:430,
				height:400,
                xtype: 'fieldset',
                title: '预约就诊情况',
                items: [
                    {
                        xtype: 'textfield',
						name:'yuyueid',
                        fieldLabel: '预约号',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'name',
                        fieldLabel: '姓名',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'proxyer',
                        fieldLabel: '代约人',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'phone',
                        fieldLabel: '电话',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
						xtype: 'combo',
						name:'sex',
						fieldLabel: '性别',
						anchor: '50%',
						name:'qudao', 
						store: Ext.user.method.sexid(),
						displayField:'name',
						valueField:'id',
						hiddenName:'qudao',
						hiddenValue:'0',
						editable:false,
						typeAhead: true,
						forceSelection: true,
						mode: 'local',
						triggerAction: 'all',
						emptyText:'请选择',
						selectOnFocus:true,
						style: 'margin-bottom:5px;'
                    }, 
                    {
                        xtype: 'textfield',
						name:'year',
                        fieldLabel: '年龄',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'proficient',
                        fieldLabel: '专家',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'starttime',
                        fieldLabel: '时间（起）',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'endtime',
                        fieldLabel: '时间（止）',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'Medicalnumber',
                        fieldLabel: '就诊号',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
                        xtype: 'textfield',
						name:'Clinicaltime',
                        fieldLabel: '就诊时间',
                        anchor: '60%',
                        style: 'margin-bottom:5px;'
                    },
                    {
						xtype: 'combo',
						fieldLabel: '回访情况',
						anchor: '50%',
						name:'visit', 
						store: Ext.user.method.visitid(),
						displayField:'name',
						valueField:'id',
						hiddenName:'visit',
						hiddenValue:'0',
						editable:false,
						typeAhead: true,
						forceSelection: true,
						mode: 'local',
						triggerAction: 'all',
						emptyText:'请选择',
						selectOnFocus:true,
						style: 'margin-bottom:5px;'
                    },
                ]
            },
            {
				colspan: 2,	
                xtype: 'fieldset',
                title: '特殊备注',
                items: [
                    {
                        xtype: 'textarea',
						name:'comment',
                        anchor: '60%',
                        fieldLabel: '备注'
                    }
                ]
            }
        ];
        Ext.user.info.superclass.initComponent.call(this);
    }
});


Ext.user.info.buttons = {};
Ext.user.info.buttons.add = {text:'入录信息',handler:function(){
	Ext.user.method.submitForm('info','/Yuyue/add/',{s:function(f,a){
		Ext.user.alert(a.result);
	},f:function(f,a){
		Ext.user.alert(a.result);
	}},'POST');
}};
Ext.user.info.buttons.reset = {text:'重置所有操作',handler:function(){
	
}};
Ext.user.infoWindow = Ext.extend(Ext.Window, {
    title: '预约情况入录表',
	modal:true,
    width: 900,
    height: 590,
	style:'margin:0 auto;',
    initComponent: function() {
		this.items = [new Ext.user.info()];
		this.buttons = [Ext.user.info.buttons.add];
        Ext.user.infoWindow.superclass.initComponent.call(this);
    }
});
